meson: work around meson/gcc bug detecting linux/* headers
authorTim-Philipp Müller <tim@centricular.com>
Sat, 11 Mar 2017 22:11:07 +0000 (22:11 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 3 May 2017 14:10:53 +0000 (15:10 +0100)
meson.build

index 196e3e155ee0b22e111f67dec2a96001a02a3511..7aee9ccda74ee63fb05510f658b84d3f8f8c762a 100644 (file)
@@ -89,7 +89,7 @@ check_headers = [
   ['HAVE_SYS_TIME_H', 'sys/time.h'],
   ['HAVE_SYS_TYPES_H', 'sys/types.h'],
   ['HAVE_UNISTD_H', 'unistd.h'],
-  ['HAVE_LINUX_MEMFD_H', 'linux/memfd.h'],
+  #['HAVE_LINUX_MEMFD_H', 'linux/memfd.h'], # FIXME: doesn't work, see below
 ]
 
 foreach h : check_headers
@@ -98,6 +98,13 @@ foreach h : check_headers
   endif
 endforeach
 
+# FIXME: cc.has_header('linux/memfd.h') doesn't work with meson 0.39 and gcc
+# https://github.com/mesonbuild/meson/issues/1458
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005
+if cc.has_header_symbol('linux/memfd.h', 'MFD_CLOEXEC')
+  cdata.set('HAVE_LINUX_MEMFD_H', 1)
+endif
+
 check_functions = [
 # check token HAVE_BIND_TEXTDOMAIN_CODESET
 # check token HAVE_CUPS_API_1_6